<template>
	<view>
		<view class="fixed">
			我的
		</view>
		<view class="card">
			<image class="bgc" src="../static/my10.svg" mode=""></image>
			<image class="headimg" :src="user.image" mode=""></image>
			<view class="left" @click="routerTo('/pages/merchant/shopInfo/shopInfo')">
				<view class="one flexc">
					<view class="me-text-beyond" style="width: 440rpx;">
						{{user.title}}
					</view>
					<!-- <image src="../static/my1.svg" mode=""></image> -->
				</view>
				<view class="two flexc">
					<view class="flexc" style="margin-right: 20rpx;">
						<image src="../static/my2.svg" mode=""></image>
						餐饮服务
					</view>
					<view class="flexc" v-if="user.trade_switch==1">
						<image src="../static/my3.svg" mode=""></image>
						营业中
					</view>
				</view>
				<view class="three flexc">
					<view class="three_item" v-if="user.authentication==1">
						实名认证
					</view>
					<view class="three_item" style="margin:0 20rpx;">
						信誉商家
					</view>
					<view class="three_item">
						{{user.user_type==1?'店长':"店员"}}
					</view>
				</view>
				<view class="four flex">
					<view class="" style="margin-right: 20rpx;">
						{{user.store.collect_counts}}人收藏
					</view>
					<view class="">
						好评率99.8%
					</view>
				</view>
			</view>
		</view>

		<view class="card_one">
			<view class="card_one_item flexc line" @click="routerTo('/pages/merchant/shopInfo/shopInfo')">
				<image src="../static/my4.svg" mode=""></image>
				<view class="text">
					店铺资料
				</view>
			</view>
			<view class="card_one_item flexc line" @click="routerTo('/pages/merchant/storeAC/storeAC')">
				<image src="../static/my5.svg" mode=""></image>
				<view class="text">
					店铺认证
				</view>
			</view>
			<view class="card_one_item flexc line" v-if="user.user_type==1"
				@click="routerTo('/pages/merchant/cashID/cashID')">
				<image src="../static/my6.svg" mode=""></image>
				<view class="text">
					提现账号
				</view>
			</view>
			<view class="card_one_item flexc" @click="routerTo('/pages/merchant/txdetail/txdetail')">
				<image src="../static/icon18.png" mode=""></image>
				<view class="text">
					提现明细
				</view>
			</view>
		</view>

		<view class="card_one">
			<view class="card_one_item flexc line"
				@tap="routerTo('/pages/order_all/login_protocol/login_protocol?name='+'关于我们'+'&state=0')">
				<image src="../static/my7.svg" mode=""></image>
				<view class="text">
					关于我们
				</view>
			</view>
			<view class="card_one_item flexc line"
				@tap="routerTo('/pages/order_all/login_protocol/login_protocol?name='+'用户协议'+'&state=0')">
				<image src="../static/my8.svg" mode=""></image>
				<view class="text">
					用户协议
				</view>
			</view>
			<view class="card_one_item flexc line" @tap="routerTo('/pages/me_all/setmessage/setmessage?sign=1')">
				<image src="../static/my9.svg" mode=""></image>
				<view class="text">
					设置
				</view>
			</view>

		</view>



		<sjtabbar :myShow='true' :pagesPath='pagesPath'></sjtabbar>
	</view>
</template>

<script>
	import {
		store_info
	} from '@/api/merchant.js'
	export default {
		data() {
			return {
				pagesPath: '',
				user: uni.getStorageSync('shopuser')
			}
		},
		onLoad() {
			this.getinfo()
		},
		methods: {
			async getinfo() {
				let res = await store_info()
				this.user = res.data
				uni.setStorageSync('shopuser', this.user)
			},
			goidx() {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			}

		}
	}
</script>

<style lang="scss">
	page {
		min-height: 100vh;
		padding: 10vh 26rpx 26rpx;
		box-sizing: border-box;
		background: #FAFAFA;
	}

	.line {
		border-bottom: 1rpx solid #f3f3f3;
	}

	.fixed {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		background-color: #fff;
		height: 10vh;
		z-index: 999;
		text-align: center;
		line-height: 13vh;
		font-size: 26rpx;
	}

	.card {
		position: relative;

		.bgc {
			width: 700rpx;
			height: 300rpx;
		}

		.headimg {
			width: 124rpx;
			height: 124rpx;
			border-radius: 50%;
			position: absolute;
			top: 38rpx;
			left: 40rpx;
		}

		.left {
			position: absolute;
			top: 38rpx;
			left: 194rpx;

			.one {
				font-size: 40rpx;
				font-weight: 500;
				color: #FFFFFF;
				line-height: 56rpx;

				image {
					width: 42rpx;
					height: 42rpx;
					margin: 4rpx 0 0 10rpx;
				}
			}

			.two {
				font-size: 24rpx;
				color: #FFFFFF;
				margin: 16rpx 0;

				image {
					width: 30rpx;
					height: 30rpx;
					margin-right: 6rpx;
				}
			}

			.three {
				margin: 20rpx 0;

				.three_item {
					width: 114rpx;
					height: 44rpx;
					background: #93DBFF;
					border-radius: 4rpx;
					font-size: 24rpx;
					color: #0075AF;
					text-align: center;
					line-height: 44rpx;
				}
			}

			.four {
				font-size: 24rpx;
				color: #FFFFFF;
			}
		}
	}

	.card_one {
		border-radius: 14rpx;
		width: 700rpx;
		background-color: #fff;
		padding: 0rpx 40rpx;
		box-sizing: border-box;
		margin: 40rpx 0;

		.card_one_item {
			height: 110rpx;
			line-height: 110rpx;
			display: flex;
			align-items: center;

			image {
				width: 50rpx;
				height: 50rpx;
				margin-right: 20rpx;
			}

			.text {
				font-size: 28rpx;
				color: #333333;
				line-height: 50rpx;
				font-weight: 600;

			}
		}
	}
</style>
